"""绘制直方图"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

fig, axes = plt.subplots(2, 1)
data = pd.Series(np.random.randn(16), index=list('abcdefghijklmnop'))
data.plot.bar(ax=axes[0], color='k', alpha=0.7)  # bar垂直柱状图
data.plot.barh(ax=axes[1], color='k', alpha=0.7)  # barh水平柱状图
plt.show()
fig.savefig("pic/ex10.png", format='png', transparent=True, dpi=300, pad_inches=0)
